<?php 

global $user,$base_url;
if($user->uid=='1' || (isset($user_s->roles[3]) && $user_s->roles[3]!="")){
 $user = user_load(arg(1));
}
$profile_node = content_profile_load('profile', $user->uid);

// echo '<pre style=color:#fff;>';print_r($profile_node);echo '</pre>';
  ?>
 <div class="edit_left_list">
 <?php
 if($profile_node->field_upload_image['0']['fid'] != ""){
  $image_filepath = $profile_node->field_upload_image['0']['filepath'];
 //print "<img src='".$image_filepath."' width='189' height='202'/>"; ?>
   <span class="profile_img"><?php print theme('imagecache', 'edit_profile', $image_filepath, '', '', array('style'=>'padding:3px')); ?></span>


<a href="<?php print $base_url."/user/".$user->uid."/edit";?>"><img height="36" width="191" src="<?php print $base_url.'/'.path_to_theme();?>/images/edit_myprofile.gif"></a>
 <?php } else {
 if($profile_node->field_gender[0]['value'] == 'Male')
 {
  $img = "male.gif";
 }
 else{ $img = "female.gif";}
?>				
            	<img height="144" width="144" src="<?php print $base_url.'/'.path_to_theme();?>/images/<?php print $img;?>">
                <a href="<?php print $base_url."/user/".$user->uid."/edit";?>"><img height="36" width="191" src="<?php print $base_url.'/'.path_to_theme();?>/images/edit_myprofile.gif"></a>
            <?php }?>
            </div>
			<div class="edit_right_list">
            	<h6><?php print ucwords($profile_node->field_first_name['0']['value']).'&nbsp;&nbsp;'.ucwords($profile_node->field_family_name['0']['value']);?></h6>
                <p style="line-height:1.5;">Hyderabad, Andhra Pradesh<br>email <?php print $user->mail;?>
				<br>mobile  <?php print $profile_node->field_mobile['0']['value'];?></p>
                <h3 class="edit_h3_head">About Me</h3>
                <p class="mypage_details_box">                
                  <?php if(!empty($profile_node->field_aboutme['0']['value']))
				  {
				  print $profile_node->field_aboutme['0']['value'];
				  }
				  else{?>
				  <a href="<?php print $base_url."/user/".$user->uid."/edit";?>">Please update your details</a>
				  <?php }
				  ?>

                </p>
                <h3 class="edit_h3_head">My Skills</h3>
                <p class="mypage_details_box">
				<?php if(!empty($profile_node->field_skills['0']['value']))
				  {
				  print $profile_node->field_skills['0']['value'];
				  }
				  else{?>
				  <a href="<?php print $base_url."/user/".$user->uid."/edit";?>">Please update your details</a>
				  <?php }
				  ?>
                </p>
                
               <span class="after_more" style="display:none;">
				        <h3 class="edit_h3_head">Experience</h3>
						<div class="mypage_details_box">
						<?php
						if(count($profile_node->field_project_title))
						{
						for($i=0;$i<count($profile_node->field_project_title);$i++){
                       print '<h4>'.$profile_node->field_project_title[$i]['value'].'</h4>';
                       print date("F Y",strtotime($profile_node->field_time_period[$i]['value'])).' to '.date("F Y",strtotime($profile_node->field_time_period[$i]['value2']))."<br />";
					   print '<p class="details_paragraph">'.$profile_node->field_proj_description[$i]['value'].'</p><br />';
						}
						}
						else{?>
						<a href="<?php print $base_url."/user/".$user->uid."/edit";?>">Please update your details</a>
						<?php }
						?>
						</div>

				        <h3 class="edit_h3_head">Education</h3>
                 <p class="mypage_details_box">
						<?php 			
						if(count($profile_node->field_college_name))			
						{
							for($j=0;$j<count($profile_node->field_college_name);$j++){

							
					     print $profile_node->field_college_name[$j]['value'].'<br/>';
					     print $profile_node->field_course[$j]['value'].'<br/>';						 
					     print $profile_node->field_specialization[$j]['value'];
					     $from = date("Y",strtotime($profile_node->field_date_attended[$j]['value']))+1;
					     $to = date("Y",strtotime($profile_node->field_date_attended[$j]['value2']))+1;					     
                         print $from.' to '.$to."<br /><br />";

						}
						}
						else{?>
						<a href="<?php print $base_url."/user/".$user->uid."/edit";?>">Please update your details</a>
						<?php }
						if(!empty($profile_node->field_languages[0]['value'])){
					     print $profile_node->field_languages[0]['value'].'<br/>';
						 }
						 else{?>
						<a href="<?php print $base_url."/user/".$user->uid."/edit";?>">Please update your details</a>
						<?php }
						?>
           
		    </p>
				        <h3 class="edit_h3_head">Interests</h3>
                      <p class="mypage_details_box">                       
					  	<?php 	
							if(count($profile_node->field_specialities))					
							{
							for($h=0;$h<count($profile_node->field_specialities);$h++){
					
					     print $profile_node->field_specialities[$h]['value'].'<br/>';
					  
						}
						}
						 else{?>
						<a href="<?php print $base_url."/user/".$user->uid."/edit";?>">Please update your details</a>
						<?php }
						?>
                        </p>
						<!--<h3 class="edit_h3_head">Convenient time for receiving SMS messages</h3>-->
<?php  //print substr($profile_node->field_time[0]['value'],11,7).' to '.substr($profile_node->field_time[0]['value2'],11,7).'<br/>';?>
           						<h3 class="edit_h3_head">Birthday</h3>
					    <p class="mypage_details_box"><?php print date("F d, Y",strtotime($profile_node->field_dob[0]['value']));?></p>
</span>
<h5 class="more_link_mypage" style="cursor:pointer;"></h5>
			</div>